package com.itheima.test4;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Author:gy
 * @Date: 2025/09/03 11:51
 * @Description:
 */
public class Demo1 {
    public static void main(String[] args) {
        ThreadPoolExecutor te = new ThreadPoolExecutor(
                2,
                5,
                2,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(5),
                Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.AbortPolicy()
        );
        for (int i = 1; i <=10; i++) {
            te.submit(new MyRunable("人员"+i));
        }
        te.shutdown();
    }
}
